home *** CD-ROM | disk | FTP | other *** search
- /*
- Component Interface.h
-
- Describes the component interface routines and their parameters.
-
- Important note about naming conventions: Read the file "API Readme.h" to understand
- the prefixes used in all of the calls...
- */
-
- #if 0 // don't include into compilation of code
-
- /* ***** Starting Up and Shutting Down ***** */
-
- pascal ICError ICCStart(internetConfigurationComponent *inst, OSType creator);
- /*
- Call this at application initialisation. Set creator to your application
- creator to allow for future expansion of the IC system. Returns
- inst as a connection to the IC system.
- */
-
- pascal ICError ICCStop(internetConfigurationComponent inst);
- /*
- It is illegal to call this routine inside a ICBegin/End pair.
-
- Call this at application initialisation, after which inst
- is no longer valid connection to IC.
- */
-
- /* ***** Specifying a Configuration ***** */
-
- pascal ICError ICCFindConfigFile(internetConfigurationComponent inst, short count, ICDirSpecArrayPtr folders);
- /*
- It is illegal to call this routine inside a ICBegin/End pair.
-
- Call to configure this connection to IC.
- Set count as the number of valid elements in folders.
- Set folders to a pointer to the folders to search.
- Setting count to 0 and folders to nil is OK.
- Searches the specified folders and then the Preferences folder
- in a unspecified manner.
- */
-
- pascal ICError ICCFindUserConfigFile(internetConfigurationComponent inst, ICDirSpec *where)
- /*
- Requires IC 1.1.
-
- It is illegal to call this routine inside a ICBegin/End pair.
-
- Similar to ICFindConfigFile except that it only searches the folder
- specified in where. If the input parameters are valid the routine
- will always successful configure the instance, creating an
- empty configuration if necessary
- For use with double-clickable preference files.
- */
-
- pascal ICError ICCGeneralFindConfigFile(internetConfigurationComponent inst, Boolean search_prefs, Boolean can_create,
- short count, ICDirSpecArrayPtr folders)
- /*
- Requires IC 1.2.
-
- It is illegal to call this routine inside a ICBegin/End pair.
-
- Call to configure this connection to IC.
- This routine acts as a more general replacement for
- ICFindConfigFile and ICFindUserConfigFile.
- Set search_prefs to true if you want it to search the preferences folder.
- Set can_create to true if you want it to be able to create a new config.
- Set count as the number of valid elements in folders.
- Set folders to a pointer to the folders to search.
- Setting count to 0 and folders to nil is OK.
- Searches the specified folders and then optionally the Preferences folder
- in a unspecified manner.
- */
-
- pascal ICError ICCChooseConfig(internetConfigurationComponent inst)
- /*
- Requires IC 1.2.
-
- It is illegal to call this routine inside a ICBegin/End pair.
-
- Requests the user to choose a configuration, typically using some
- sort of modal dialog. If the user cancels the dialog the configuration
- state will be unaffected.
- */
-
- pascal ICError ICCChooseNewConfig(internetConfigurationComponent inst)
- /*
- Requires IC 1.2.
-
- It is illegal to call this routine inside a ICBegin/End pair.
-
- Requests the user to create a new configuration, typically using some
- sort of modal dialog. If the user cancels the dialog the configuration
- state will be unaffected.
- */
-
- pascal ICError ICCGetConfigName(internetConfigurationComponent inst, Boolean longname, Str255 name)
- /*
- Requires IC 1.2.
-
- You must specify a configuration before calling this routine.
- Returns a string that describes the current configuration at a user
- level. Set longname to true if you want a long name, up to 255
- characters, or false if you want a short name, typically about 32
- characters.
- The returned string is for user display only. If you rely on the
- exact format of it, you will conflict with any future IC
- implementation that doesn't use explicit preference files.
- */
-
- pascal ICError ICCGetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref)
- /*
- Requires IC 1.2.
-
- You must specify a configuration before calling this routine.
- Returns a self-contained reference to the instance's current
- configuration.
- ref must be a valid non-nil handle and it will be resized to fit the
- resulting data.
- */
-
- pascal ICError ICCSetConfigReference(internetConfigurationComponent inst, ICConfigRefHandle ref, long flags)
- /*
- Requires IC 1.2.
-
- It is illegal to call this routine inside a ICBegin/End pair.
-
- Reconfigures the instance using a configuration reference that was
- got using ICGetConfigReference reference. Set the
- icNoUserInteraction_bit in flags if you require that this routine
- not present a modal dialog. Other flag bits are reserved and should
- be set to zero.
- ref must not be nil.
- */
-
- pascal ICError ICCSpecifyConfigFile(internetConfigurationComponent inst, FSSpec *config)
- /*
- It is illegal to call this routine inside a ICBegin/End pair.
-
- For use only by the IC application.
- If you call this routine yourself, you will conflict with any
- future IC implementation that doesn't use explicit preference files.
- */
-
- /* ***** Getting Information ***** */
-
- pascal ICError ICCGetSeed(internetConfigurationComponent inst, long *seed)
- /*
- You do not have to specify a configuration before calling this routine.
- You do not have to be inside an ICBegin/End pair to call this routine.
- Returns the current seed for the IC prefs database.
- This seed changes each time a non-volatile preference is changed.
- You can poll this to determine if any cached preferences change.
- */
-
- pascal ICError ICCGetPerm(internetConfigurationComponent inst, ICPerm *perm)
- /*
- You do not have to specify a configuration before calling this routine.
- Returns the access permissions currently associated with this instance.
- While applications normally know what permissions they have,
- this routine is designed for use by override components.
- */
-
- pascal ICError ICCDefaultFileName(internetConfigurationComponent inst, Str63 name)
- /*
- You do not have to specify a configuration before calling this routine.
- You do not have to be inside an ICBegin/End pair to call this routine.
- Returns the default file name for IC preference files.
- Applications should never need to call this routine.
- If you rely on information returned by this routine yourself,
- you may conflict with any future IC implementation that doesn't use
- explicit preference files.
- The component calls this routine to set up the default IC file name.
- This allows this operation to be intercepted by a component that has
- captured us. It currently gets it from the component resource file.
- The glue version is hardwired to "Internet Preferences".
- */
-
- /* ***** Reading and Writing Preferences ***** */
-
- pascal ICError ICCBegin(internetConfigurationComponent inst, ICPerm perm)
- /*
- You must specify a configuration before calling this routine.
- It is illegal to call this routine inside a ICBegin/End pair.
- Starting reading or writing multiple preferences.
- A call to this must be balanced by a call to ICEnd.
- Do not call WaitNextEvent between these calls.
- The perm specifies whether you intend to read or read/write.
- Only one writer is allowed per instance.
- Note that this may open resource files that are not closed
- until you call ICEnd.
- */
-
- pascal ICError ICCGetPref(internetConfigurationComponent inst, ConstStr255Param key, ICAttr *attr, Ptr buf, long *size)
- /*
- You must specify a configuration before calling this routine.
- If you are getting or setting multiple preferences, you should place
- these calls within an ICBegin/ICEnd pair.
- If you call this routine outside of such a pair, it implicitly
- calls ICBegin(inst, icReadOnlyPerm).
- Reads the preference specified by key from the IC database to the
- buffer pointed to by buf and size.
- key must not be the empty string.
- If buf is nil then no data is returned.
- size must be non-negative.
- attr and size are always set on return. On errors (except icTruncatedErr)
- attr is set to ICattr_no_change and size is set to 0.
- size is the actual size of the data.
- attr is set to the attributes associated with the preference.
- If this routine returns icTruncatedErr then the other returned
- values are valid except that only the first size bytes have been
- return. size is adjusted to reflect the true size of the preference.
- Returns icPrefNotFound if there is no preference for the key.
- */
-
- pascal ICError ICCSetPref(internetConfigurationComponent inst, ConstStr255Param key, ICAttr attr, Ptr buf, long size)
- /*
- You must specify a configuration before calling this routine.
- If you are getting or setting multiple preferences, you should place
- these calls within an ICBegin/ICEnd pair.
- If you call this routine outside of such a pair, it implicitly
- calls ICBegin(inst, icReadWritePerm).
- Sets the preference specified by key from the IC database to the
- value pointed to by buf and size.
- key must not be the empty string.
- size must be non-negative.
- If buf is nil then the preference value is not set and size is ignored.
- If buf is not nil then the preference value is set to the size
- bytes pointed to by buf.
- If attr is ICattr_no_change then the preference attributes are not set.
- Otherwise the preference attributes are set to attr.
- Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
- Returns icPermErr if current attr is locked, new attr is locked and buf <> nil.
- */
-
- pascal ICError ICCFindPrefHandle(internetConfigurationComponent inst, ConstStr255Param key, ICAttr *attr, Handle prefh)
- /*
- Requires IC 1.2.
-
- You must specify a configuration before calling this routine.
- If you are getting or setting multiple preferences, you should place
- these calls within an ICBegin/ICEnd pair.
- If you call this routine outside of such a pair, it implicitly
- calls ICBegin(inst, icReadWritePerm).
- This routine effectively replaces ICGetPrefHandle.
- Reads the preference specified by key from the IC database into
- a handle, prefh.
- key must not be the empty string.
- attr is set to the attributes associated with the preference.
- You must set prefh to a non-nil handle before calling this routine.
- If the preference does not exist, icPrefNotFoundErr is returned.
- */
-
- pascal ICError ICCGetPrefHandle(internetConfigurationComponent inst, ConstStr255Param key, ICAttr *attr, Handle *prefh)
- /*
- Requires IC 1.1.